﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:v="clr-namespace:ShredTheLog.Views;assembly=ShredTheLog.Views"
    xmlns:vm="clr-namespace:ShredTheLog.ViewModels;assembly=ShredTheLog.ViewModels"
    xmlns:cnv="clr-namespace:ShredTheLog.Converters;assembly=ShredTheLog.Converters"
    xmlns:c="clr-namespace:ShredTheLog.Controls;assembly=ShredTheLog.Controls"
    >

    <DataTemplate DataType="{x:Type vm:InputViewModel}">
        <DataTemplate.Resources>
            <Thickness x:Key="ButtonMargin" Left="{x:Static c:UX.ButtonSeparatorWidth}" Top="{x:Static c:UX.DialogPadding}"/>
        </DataTemplate.Resources>

        <Grid Margin="{x:Static c:UX.DialogPaddingThickness}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <DockPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
                <Label DockPanel.Dock="Left" Content="{Binding Prompt}" VerticalAlignment="Center" Target="textBox"/>
                <TextBox x:Name="textBox" Text="{Binding Path=InitialValue, Mode=OneTime}"/>
            </DockPanel>
            
            <Button Grid.Row="1" Grid.Column="1" Content="{c:LocalizedString s_OK}" IsDefault="True" Command="{Binding ProcessInputCommand}" CommandParameter="{Binding ElementName=textBox, Path=Text, Mode=OneWay}" MinWidth="{x:Static c:UX.ButtonWidth}" Margin="{StaticResource ButtonMargin}"/>
            <Button Grid.Row="1" Grid.Column="2" Content="{c:LocalizedString s_Cancel}" IsCancel="True" Command="{Binding CloseCommand}" MinWidth="{x:Static c:UX.ButtonWidth}" Margin="{StaticResource ButtonMargin}"/>
        </Grid>
    </DataTemplate>
</ResourceDictionary>